/*
 * macros/state_block.c
 *
 * (C) 2011 Harry Wei
 */

/*
 *  GNU-EXTEND c language.
 *  Discuss the define macros.
 */

#include <stdio.h>

#define even(x) (2 * (x / 2) == x ? x : x + 1)
#define evenint(x)	\
	({int y = x; \
	 (2 * (y / 2) == y ? y : y + 1); \
	 })

int main(void)
{
	int num = 7;
	int numint = 4;
	int result = 0;

	result = even(num);
	printf("result of even: %d\n", result);
	result = evenint(numint);
	printf("result of evenint: %d\n", result);
	return 0;
}
